package com.commerce.recording;

import androidx.collection.ArraySet;

import com.commerce.recording.entity.Record;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Singleton {

    private boolean check = false;
    private Set<Record> checkRecord = new HashSet<>();

    private static Singleton instance = new Singleton();

    private Singleton(){

    }
    public static Singleton getInstance(){
        return instance;
    }

    public boolean isCheck() {
        return check;
    }

    public void setCheck(boolean check) {
        this.check = check;
    }

    public List<Record> getCheckRecord() {
        return new ArrayList<>(checkRecord);
    }

    public void addCheckRecord(Record checkPath) {
        this.checkRecord.add(checkPath);
    }

    public void removeCheckRecord(Record checkPath) {
        this.checkRecord.remove(checkPath);
    }
    public void clear(){
        checkRecord = new HashSet<>();
    }
}
